# -*- coding:utf-8 -*-
# exception test
import sys

# try:
#     while True
#         print('hello')
# except SyntaxError:
#     print('un')
# except:
# # print('Unexpected error:', sys.exc_info())
#     print('Unexpected error:')
import sys

try:
    # 1/0
    # a
    '1' + 1
    1+1
except ZeroDivisionError:
    print('ZeroDivisionError:', sys.exc_info()[1])
except NameError:
    print('NameError', sys.exc_info())
except TypeError:
    print('TypeError', sys.exc_info())
except:
    print('Unexcepted Error', sys.exc_info())
else:
    print('no exception')
finally:
    print('exception or not, I will show')
# while True:
#     try:
#         ints = int(input('please input a int:'))
#         break
#     except ValueError:
#         print('ValueError: input is not int')

#
# try:
#     f = open('testFile6')
# except IOError as e:
#     print('OS error: {0}'.format(e))




